#include "MyObject.h"
#include <iostream>

Pool MyObject::pool(sizeof(MyObject), 5, false);

void * MyObject::operator new(size_t size)
{
	return pool.allocate();
}

void MyObject::operator delete(void * ptr)
{
	pool.deallocate(ptr);
}

//std::ostream& operator << (std::ostream& os, const MyObject& mo)
//{
//	return os << "( ID: " << mo.id << " , NAME: " << mo.name << " )";
//}

string MyObject::getString()
{
	char buffer[80];
	sprintf_s(buffer, "{%i,", id);
	string tmp(buffer);
	tmp += name;
	tmp += "}";
	return tmp;
}
